package org.swimv2.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the messaggio database table.
 * 
 */
@Embeddable
public class MessaggioPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	private String IDmittente;

	private String IDdestinatario;

	@Temporal(TemporalType.TIMESTAMP)
	private java.util.Date data;

	public MessaggioPK() {
	}
	public String getIDmittente() {
		return this.IDmittente;
	}
	public void setIDmittente(String IDmittente) {
		this.IDmittente = IDmittente;
	}
	public String getIDdestinatario() {
		return this.IDdestinatario;
	}
	public void setIDdestinatario(String IDdestinatario) {
		this.IDdestinatario = IDdestinatario;
	}
	public java.util.Date getData() {
		return this.data;
	}
	public void setData(java.util.Date data) {
		this.data = data;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof MessaggioPK)) {
			return false;
		}
		MessaggioPK castOther = (MessaggioPK)other;
		return 
			this.IDmittente.equals(castOther.IDmittente)
			&& this.IDdestinatario.equals(castOther.IDdestinatario)
			&& this.data.equals(castOther.data);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.IDmittente.hashCode();
		hash = hash * prime + this.IDdestinatario.hashCode();
		hash = hash * prime + this.data.hashCode();
		
		return hash;
	}
}